altered document ready to run on page load