added swiping logic