added tile detection