adding listMidPoint
handling tab-separated inputs and newlines in strtok