Removed usage of the global *lines* and *cols* variables