pagination code improved a lot :)