velocity is calcualted using dr blacks code, changing yours