completed serial connection stuff (untested)