Changed some signatures around that might make coloring a bit simpler later. Also changed the chgState a bit because it didn't make sense to me