Added window, document to first function