switched to scp, rm for tmp files and added additional configs for xtrace and debugging