using sorting