Photometric method from Maheswar et al. (2010) to determine distances to molecular clouds using 2MASS data