added hasPrev() and  hasNext()

Thank your for this smart swiping solution.
I just added two new public methods for convenience (starting at line 510): hasPrev() and hasNext() .
The other modifications are results rom atomatic line conversion.