Add constant variables and tidy main loop