added serial communication funcions