Added more code to colour encoding