some revisions for ubuntu. can't handle auto ranged loops