Put heavy computations outside of loop. Should be fast also now.