Added sorting and iteration to models.