Working on constant state variables, fixing some bugs