Fixed chaining implementation. Now prints the correct number of items
Added comments to code