Added implementations to the provided skeleton functions.