updated to use C99 complex types