finished implementing controller pattern