used heredoc, fixed PC reset when PC is off