fixed bug in frequency of checks, going to change checks for matrices from equality comparison to hash comparison
changed matrix checking from equality comparison to hash comparison