updated recursive calls and checks for tiling