After completing assignment

Updated provided stub to write required functions.