updated controller functions and views