updated to return results in the window instead of an alert.