getState function

Return state names at specified locations