New implementation
Change the way empty lists are handled
Implementation of get_substory
Removal of commented code