Converted into a class

Made this into a class to be able to access dictionary outside of it