Modified controller and diagram class