put serial interaction into function