Added some comments to make it easier for others to understand. Added CC license as well
I thoguht I already comitted