improve the model, implement the stats html page