pagination for beginner codes