use x instead of line, because line is not defined in the function context