refactor prev()

It would be better to use camelCase names. `hasPrev` instead of `hasprev` (also to be consistent with `hasNext` in #18).