Implemented functioning delete function.