fixed typo
moved stuff around and fixed namespace issues