How did the revolution help in the writing of the constitution?