created a forEach loop in temp