fix some problems and also implement delete all, functionality