stuffed everything in functions; added testing for a won game