Changed the way the functions work and added a new calculation.