speed is undefined, need to change to @speed