using class to store transitions and codes together