Implemented solution for being able to win