Converted to code blocks