Removed SelectionStates. Formatted code.