added hasPrev() and  hasNext()