added a function with issetand  and added href's for pagination ability