improved gridToText method for more spacing and compatibility with grids more than 1 digit in size