Fixed minor bug and added winning functionality