wrote all functions, not all the tests