What are the functions of a settlement?