stats calculations, and updated main