Finished resisance rules.  Added test cases. Fixed bugs.