Corrected slide logic

Add flags to control slide left and right.
Correcte slide logic.