add Purfunction algrithm