cleaned up entropy algorithm, changed to threshold method from top N (old code is still there, just commented out)