added some comments to explain the colouring process