Changed tiles to take a tileObject and updated tiles code.