Implement compare method to num