Made script into a self-standing python script.
Added a doctest comment. Please add one for each method.