Added function documentation