update linear algebra and stat
clean optimization