Added window.Compare function