revised codeblock handling