Working version with submodules