Completed code with 11 tests