Implementation is correct but naming and documentation is confusing. It's not `rootWindow` it's just `parentWindow` if it was `rootWindow` it would misbehave. Please make sure to update naming and comments above to avoid confusing a reader.