init function for setting up serial port