finished controller. not yet totally working somehow