removed unused var and corrected the function used in the single number case