first part of assignment 3 -A common base class for controllers