modified tiles code