Memory management working again for preliminary tests. Memory errors for later implemented features.