a few changes to perform pipe-like processing
changed way function composition works