function to decide who wins is now working