updated controller for neatness