added some changes to recongition of speed