added swiping functionality, handling zero div.