fix #3: iterate over values instead of index