Code updated

Various changes for calculationg distance and time of moving.
NOT FINISHED YET