COMPLETE WORKING SIMULATION