Document some function and new tests