added functions to controller
new stuff
removed duplicate