table reworked and controller function worked on