Added another test and put some tolerance into the tests. The solution requires 1e-9 precision.