Yes, that is better. I also added some more comments to make it more clear what happens here.