Implemented intermediate result deleting