Updated constructor for inserting