Move preprocessing code outside main
Rename main to setInMotion