added optional end to module-defn