worked on simulation functions