Switched to using Flex and C