Added GPL license. Simplified a dictionary comprehension in sim