usort

use 0,1,-1 return values instead of just true, false which will be casted as 1,0