begin statistics calculation into it's own class
Move #sorted_hash into Stats class
Extract complexity into simpler methods in Stats class