Painfully he tried to puzzle out what had happened.
Painstakingly, he tried to piece together what had happened.