Added working sorter and generator

Added performance doc