added some comments
fix a warning about the wrong enum type