adding up to M