Worked on #3. I believe the problem is unsolvable without a special handling of functions with applications