Update thread, math from develop.