simplified cleanup
bug fixing, eliminated multiple inserts, update is broken