Implementing field sorting