added support for programs that are wrapped in blocks due to require statements at the top