Updated code.  Added controller class