changed Boolean to boolean, added PDF support, some refactoring