All functions verified and corrected after running their examples.