Fixed onfoot ped sync
Cleaned up some code