created my own forEach function