restored the original methods to keep backwards compatibility
corrected the missing global
minor style tweaks to make the system cleaner
corrected the class name