added styling/logic for next/previous page