modified to match the new logic
Merge branch 'master' of http://github.com/toerq/OSM-project