Update sorting and added variables and helpers.