Finished the delete functionality; bug fixes