add notes and fixed some problems