Modify misc/foreach for better format