Add function to M