functional library
TODO modified