Updated functions and documentation