Added some basic doctests and cleaned up data structures