creating the main controller