modified ERD & script