finishing the basic coding for the controller, need to test