polished it off

fixed it so that it can actually calculate the formula