Modifying code created by dharanikumar to allow for swiping from left to right.