new code from rm