mate function
update