Started work on simulation function