added basic gesture detector code