Fixes to menu code to make it run.
Moving around imports and defining variables.