This definitely needs a docstr.  And should be thoroughly commented.