Fairly big update

Added an auto-loading feature instead of doing it all by hand. However, I am having trouble setting $val, and I'm not even sure if I need $val. I'll look more into it tomorrow.