Now th game ends when all the colors are the same.
Added comments to the recently added code.