added comments for mainController