Redoing the math here to make it more understandable.