worked on simulation mode