Fixed a sign issue in the determineOutput funciton in the controller class