conditional for the right arrow works
 by using unshift instead of push