useing foreach