public ListNode swapPairs(ListNode head){
		if(head == null)
			return null;
		if(head.next == null)
			return head;
		ListNode pointer = head;
		ListNode newHead = head.next;
		int counter = 1;
		ListNode lastNode = head;
		while(pointer.next != null){
			ListNode temp = pointer.next;
			if(counter%2 == 1){
				lastNode = pointer;
				if(pointer.next.next == null)
					pointer.next = null;
				else if(pointer.next.next.next == null)
					pointer.next = pointer.next.next;
				else
					pointer.next = pointer.next.next.next;
			}else{
				pointer.next = lastNode;
			}
			pointer = temp;
			counter++;
		}
		
		if(counter %2 == 0)
			pointer.next = lastNode;
		
		return newHead;
	}