added step-by-step comments