simplify vertical slide checking logic