restructured to use as submodule