Tried a function pointer in delete() and it worked! Rewrite code now to be way more efficient