delete functions and fixes