One other thing. If this was a real problem, you probably would not want to use 10000 as the first subscript limit of your arrays. 10000 is divisible by 16, so you are near the breakpoint for bank conflicts when making consecutive references on the second subscript. You might try making the subscript limit 10001 and see if you get any speed up.