implemented top-level define and begin syntax