Improved function documentation