AN function works!

I still get a few warnings, but no fatal errors