Working version of RCM