Data being added to database. Not quite right. Need to sort out what insert is in loop