uses foreach