fixing delete bug and improving commenting