buildERD() done but not tested