header file redesigned, bug fix