Work with partially defined functions. Speed. significantly worse.
Final version
final version