Updated to Danack/code with the fix for eating braces.