adapting code to change colour