Rewrote scripts to reference current map (for widget functionality)