Made speed variable functional