now compiled with -std=c99