added some boundary checking for a few coordinates when swiping up