added missing files, and made most of the runtime private