implement parseGrid