Converted to c99 and now uses stdbool