Added window closing logic. Also added test suite but it's empty