some light modification added