implemented everything up to a won match