initial conversion from jquery.hammer.js (doesn't work)