added spec tests, added winner determination