Began work on the code portion after finishing the derivation.