def dl_mM(m, M, Kcorr=0.):
    """
    returns luminosity distance in Mpc given
    apparent magnitude and absolute magnitude
    
    Parameters
    ----------
    m : apparent magnitude
    M : absolute magnitude in the source frame
    Kcorr : (optional) K correction, to convert absolute magnitude from the 
        observed band to the source frame band (default=0).  If fluxes are 
        bolometric, this should be left as 0. If not, a K correction of 0 is
        only valid at low redshifts.
        
    Returns
    -------
    Luminosity distance in Mpc
    """
    return 10**(0.2*(m-M-Kcorr-25))