First part of calculating constants.