fixed #define, added some comments