Improved the controller so it would be easier to integrate