Box Trace isn't working correctly

If you make the function, then could have some variables that if you change location or tile size, this could take care of it.