Adds support of sort, first and last