Solution to the homework
Unit tests for the functions