Completed all basic functions for part B of the lab