debugged 'map' for lists