implement as_complex