Working functions
Failed test #4, Passed 9 tests