Added functionality to tile.cpp 1