Added in the function to calibrate clock frequency. Also created an initProgram function to consolidate the initialization functions.