Added C99 flag. Tidied up top level