updated controller and helper methods with feedback from Jack on better formatting