fixing up pulsating brightness calc