Updates for d) . Not exactly tested ^^'