Updating to use iterators, updating testing logic to be more clear