Actually we don't need parseInt in sortNodes function.