improved readVarLine