Hat finally working, changed the values to flags to normalize the code and allow for bit ops