added debugging and autoloader