updating maximum velocity