Finished functionality and test
Found an issue where some patterns don't get pushed to the top.
Refactored and re-architected

Added view and vew logic