added border style
optimized swiping code