updated simulation for easier coding