Improved code and streamlined some stuff for less bugs.