some bugs fixed and clarifications