Changed formatting, added tests for states.