added functionality for loc1.shape(1xn), loc2.shape(nx2)