Please add doc string explaining this function. Same for function below.