writing speed control functions