add testing code, pdf docs