Calculating the Distance to Supernovae