adding rm function