added routine to check for saturation