replace code (use the system function)