Slight changes to allow Q1 code to be used for Q2 - now pass simulation time in ms