Iimplementig sorting table fields