creating foreach