correcting simulation function

this is still a trial function currently running in sample data