Moved allocation out of main loop and reduced steps to 1e5