Finished implementing methods for part b.