Modified the code so that the output is not renormalised between 0 and 255