fixing bug with calculating swipe speed