added some comments about the implementation