many changes for use with related tables