Thanks a lot for your attention and comments!  I'll fix the formatting and add tests; this is my first contribution to SymPy so I'm still learning.