using BOOST_FOREACH instead for()