use indices with velocity too
fixed a formula