Adding rmi function.