added funcitonality for start and end pages