Imported base rc code.