added swipe suppord and fixed some bugs