final serial library, modified timeout functions