calculateM