updated to use autoloading and namespaces