More allocation & deletion code. Now leak-free.