updated to allow primary key definition