cache variables that need calculation
// In the case of a jQuery selector, we could cache the DOM element.
let navright = document.querySelector('#right');
let navleft = document.querySelector('#left');
let navup = document.querySelector('#up');
let navdown = document.querySelector('#down');