1. currying 2. tail recursion