Better way for sonic calculations