step-by-step re-implemenation for schraddi