Changed how it calculates velocity from socket data