First draft of main controller file