Functional Verion of RCE algorithm