mmr hopper first cut
mmr cut 2 with sorting, searching and code optimisation