change Makefile to use clang++ and -stdlib option.
renamed a variable.
rewrite with new classes and inline functions