functions created

created functions (had to do two) for the calculations.