added some comments here and there