adding simple tile-splitting code