deletestruct function created