added some comments to explain the basic idea behind each class