logic/syntax errors fixed, but something wrong with insertion