added fromGridToString, Refactored some code