Code improvement

Improved functionality of greenBottles and the grid function. Converted the linear search to a character replacer.