comments to 2nd solution

added some brief comments and a print function