working on checkforwin logic