The assembly was bicameral with a senate that had six-year terms divided into two classes and a house of representatives with three-year terms. The senators were chosen by the provincial assemblies and the representatives were chosen by an electoral college picked by a limited public franchise. The task of the assembly was to write a permanent constitution, draft legislation, approve the budget and treaties, ratify the cabinet, and impeach corrupt officials. An independent judiciary with a supreme court was also provided. Early law codes were based on reforming the Great Qing Legal Code into something akin to German civil law.