V0.25 mate function

Continued work on the mate function.  Still needs to be tested.