Added useful comments. Recognize click vs swipe properly.