updated with more comments and functionality

added integer representation of type and a couple functions to use type