cleaned up function documentation