added some comments for my benefit