Rewrote Cam's code to use GMAP instead of LOOP.