Updated docstring.
Removed commented code, replaced setdefault with get.