unnecessary sort function removed