Assignment was finished. First version of the completed assignment with both required functions.