algorithm gives correct output

algorithm now gives correct amount of rules per test