Added code explanation