moved some functions around still need to implement check for winner correctly