change to C, uses C99 standard