assignment 3 simulation