Everything important done except insert has a bug