Kind of working, but need a better iteration pattern