Converted to C99