fixed some problem and added some notes