added rule support to the file saving and loading