Range for replaced with iterators to be compatible with gcc4.4