More documentation clarifications
More work on the pattern based algorithm. Fixed some inconsistencies in some documentation.
Removed legacy sorting code