implemented pagination on pure rails branch