changed to autoload functions which at least work!