Manhattan for simulator

Implemented manhattan algorithm for the simulator