[min] added comments to complex code