The code appears to be incomplete in that some functions it requires are not present.
Thank you for that. I will update the post.