Removed not needed function changeGridToArray