Map.fitByWeights implemented and tested