Removed unnecessary loop, went from 4 seconds runtime to 1 second