added invert_complex method