Remove the use of malloc in favor of new []