Finish and clean up controller

Pls merge the controller file to the master branch.