Added dynamic Latch.  Minor refactoring.