made changes to controller to acommodate new paginate