Fixing non-functional pieces of code to match lcoations with centroid centers i migration fxns.r