Second homework - added the last function