Rules 1-4 fixed & switchs refactored