Contact sort code

Signed-off-by: Eduardo Lasso <elassol@hotmail.com>