https://devhubby.com/thread/how-to-calculate-momentum-using-rust