Improved curryIt() solution