added documentation and merged header features