Updated codeblocks solution