First version working completly for general project case.