add function can now have newline to separate numbers, both test and the implementation