completed logic for 2NF insert