updated explanation in code