Working on mem leaks
Switched to templates!!!!