replaced tonumber(io.read()) with io.read(*n)