comments had been added, fixed some small bugs