Do not allow the chunk_size to be smaller than 10000
Residual table index column name should be extracted from source table
Changes to reflect discrepancy between story and train function
fix major issue when q=0