implemented win and lose conditions, need to implement functions