updated to compile using 'gcc -ansi'