only use complex numbers where needed and better argument validation