fixed Map and calculations