use forEach functions to iterate - removed last TODOs