removed simulation object and cleaned up code