add funtion to compute luminosity