updated to use new instead of malloc... derp