implementing horizontal shifting
refactored sliding functions, added arrow key handler