added explanation code