adding types for real and complex numbers
correct placement of parameter
correct data length
code demo