Rewrinting code from the scratch