add code for the method forEach