added 3 values frequency, ref #47
added test cases 31-42, ref #47