Implement Controller.cpp per specification in lecture notes.