removed unnecessary code
implemented prev/next