Fixed complex number function
Added test cases