replaced obsolete map()