fixed typo
fixed typeing errors
defined namespace based on c++ version