I had to do a lab and had to calculate the molar mass for a substance with this equation MM=Mrt/pv but we had to calculate the mass of the substance and its temperature experimently.

My question is why did we have to boil the liquide in a water containing becker.
Why did we have to use the mass of the substance after we evaporate it and cools down why cant we just calculate the mass when it was in liquide form