re-rolled patch #4, fixed cs errors.