smart pointer stuff seems to work. moved headers to include directory