delete semi refactored
partially tested add