gave code error checking and captioned the window