Added location measure function