Modeling the magnetic properties of Heusler alloys