Wrote 2 functions based on the samples in the assignment; modified them to meet the requirements of the assignment; added documentation