single for in the update
multithreading attempt (commented out)