Utilizing foreach