PORTLAND (AP) – Maine State Police plan to find out what was in a Canadian man’s laptop computer to find out what was in his mind when he allegedly gunned down two men who were on the state’s online sex offender registry before killing himself.

A detective on Wednesday retrieved Stephen Marshall’s computer and personal belongings from Boston, where police say he fatally shot himself on a bus.

The computer will be turned over to the Maine Computer Crimes Task Force, which will perform a forensic examination on it.

“They’ll see what’s on it, and hopefully it’ll provide some answers,” said Stephen McCausland, spokesman for the Maine Department of Public Safety. “Hopefully this will help explain the violence that occurred.”

Police think that Marshall, who lived in North Sydney, Nova Scotia, stole a pickup truck and guns from his father’s home in Houlton and drove to Milo, where he killed Joseph Gray, 57, in his home at about 3:30 a.m. Sunday.

Five hours later, the 20-year-old Marshall showed up at Elliott’s mobile home, 30 miles away in Corinth, and killed him, police said. Both men died of multiple gunshot wounds, according to the medical examiner’s office.

The common link between the victims was the sex offender registry.

Gray was on the registry for a 1992 conviction in Massachusetts for sexual assault on a child under 14. Elliott was convicted of having sex with an underage girl when he was 19.

Marshall visited the online sex registry, where offenders’ names, photos, hometowns, dates of birth and convictions are listed. Marshall also accessed additional information – including aliases and exact addresses – on 34 registered offenders.

Those people were notified Sunday and Monday that Marshall had accessed their registry files, McCausland said. As far as police can tell, Marshall didn’t contact any of them.

Friends and family members have been at loss to explain why Marshall, a quiet restaurant dishwasher with a passion for computers, might have done what he did.

Investigators believe information from Marshall’s computer may explain what motivated him.

At the Maine Computer Crimes Task Force, trained experts will use special machinery and know-how to look at the computer’s Internet history and search terms used to scour the Internet, said state police Sgt. Glenn Lang, who heads the task force.

They’ll examine e-mail, spreadsheets, documents, journals, photographs and other things to get a better understanding of the case, Lang said. They’ll try to determine if Marshall posted a profile of himself on the Internet, or if he had online storage space where he kept documents or information outside of his computer.

There’s no telling what will turn up.

In a recent robbery case, for instance, a computer examination revealed that the suspect had typed “successful armed robberies” into an Internet search engine.

In a 2002 murder case in southern Maine, a search of the suspect’s computer discovered a to-do list that included renting a car and getting ammunition, gloves, a pillow and garbage bags, Lang said. The document showed up on the computer hard drive even though it was either deleted or was never saved, Lang said.

Police in Maine alerted Massachusetts authorities that Marshall might be on one of two buses after finding his father’s pickup truck in Bangor and some bullets dumped in a toilet tank at the Bangor bus station. The bullets were the same caliber as one of his guns.

When the bus stopped at a signal at a ramp leading into Boston’s South Station, an MBTA police officer asked the driver to turn on the interior lights.

Before the officer could board the bus, a gunshot went off. Marshall was found in a seat, a gunshot wound to his head and blood splattered on several passengers.

One of the passengers, Barbara Josselyn of Farmington, told the Boston Globe that she thought police should have waited to make a move until the bus was in the station and passengers were getting off. Josselyn and her children were sitting behind Marshall, and the incident has traumatized them, she said.

John Martino, deputy MBTA transit police chief, said there were about 40 people in the bus and about 1,000 inside the bus terminal.

“It’s our job to minimize risk inside the terminal, and the only way to do that was to resolve the situation outside the terminal,” he said.

As it turns out, police are lucky they located Marshall at all. The bus he was on was due to arrive in Boston at 7:15 p.m., but was delayed an hour after it caught fire and the bus company had to change buses in Lewiston.

If there hadn’t been a delay, the bus would have arrived in Boston before Maine police called the MBTA.

“He probably would have gotten off the bus in Boston and we may still be looking for him today,” McCausland said.