Modified to work with CodeBlocks