removed debugging printout
refactored index method
refactored next/previous