reworked 2nd problem with map