updated with some comments