Task completed through help but needed explanation how its working