Adding key delete function, and cleaning up everything.