serializes dictionaries

Improves runtime.