Adding some enforcement rules and fixing the style baddies
Cleaning up the latch logic