Adding spacerules, spacestate and spacestatechange