implemented nat and ruler function.