Fix naming issues and move getElements from inside a function to window.onload