Some Changes

Moves pattern matching into the Algorithm assembly and made a few more
changes