Modified to correct legend problem with colours