adding pins controller and simplifying