Explain the functions of the legislature in a modern state.