Updated main controller