tweaking foreach stuff