added comments to final solution