How is the mortgage calculation formulated?