a fancy javascript map