added spatial support, distance and unit settings