Edited so that the stateSpace property is set correctly.