Added variable column to output data frame. Cleaned documentation.