Replaced if statements with an array of colours, matching numbers with indexOf