improved commenting
added die on argument error for replace