Adding return values and documentation.