added PDF functions
simple CRP has been implemented
added some comments