changes state to be a method and removes compares