hacky pexpect script