JAMES McAndrew had spent months studying and reprogramming the servers on his home computer recently, according to a friend, learning the ins and outs of their networks and how to fix what was broken within.

An "incredibly bright" man, the 23-year-old recent Penn State grad was also "avidly studying" his twin brother's schizophrenia, according to one of James' friends. James tried to understand the ins and outs of how it affected his brother's mind and, if possible, how to fix what was broken within him.

But before he could fully understand, McAndrew's brother, Joseph Jr., killed him; their father, Joseph Sr., 70, and their mother, Susan, 64, with an 18-inch sword in the family's Gulph Mills home on Saturday night, prosecutors said.

Police were called to the house on Holstein Road by a tenant, Craig Noce, according to the arrest affidavit. Noce told police that he'd heard Susan McAndrew yell for him to call 9-1-1. He then heard glass breaking and a loud crash before the house became "eerily quiet," the affidavit said.

Upon his arrest, Joseph Jr. said that the killings were an "extermination" and that an "attacker" killed "person named brother," "person named father" and "person named mother," according to the affidavit.

Montgomery County District Attorney Risa Ferman said yesterday that all of the victims suffered multiple stab wounds to their bodies but that James McAndrew suffered the worst.

Joseph Sr., a retired Philadelphia teacher who leaves behind two older daughters from his first marriage, had no defensive wounds on his body, which means he may have been surprised in the attack. James had the most, indicating perhaps that he had tried to protect his parents.

That doesn't surprise James' friend Zach, who attended Penn State with James and considered him one of his best friends. Zach asked that his last name be withheld.

"He thoroughly loved and appreciated what his parents had done for him," Zach said of James.

He said James would often make the more than three-hour drive home from Penn State to spend time with his family.

"I personally felt that he was almost over-attached to his family and this would potentially hurt his future, but given the state of his brother this makes more sense to me now," Zach said.

James would only briefly mention his brother's condition and when he would talk about him would say only good things, like how well he did on his college-entrance exams, even though Joseph Jr. never went to college, Zach said.

Neighbors said Joseph Jr. tended to stay inside, in his room. Ferman said he was "very much a loner and introvert." He has been charged with three counts of murder.

Ferman said it's not known who owned the 18-inch sword, described in the arrest affidavit as a samurai-style sword, or where it came from. She said it was found in the living room.

Michael Notis, professor emeritus at Lehigh University who studies the material science of Japanese work, said that at 18 inches, the sword was most likely a Japanese Tanto sword and not a samurai sword.

He said they can be bought at local gun shows or at Kendo martial-arts clubs. Either way, he said, they are deadly.

"They are very, very sharp," he said.

Before Joseph Jr. allegedly attacked his family with a sword, he was attacked himself by a mental-health disorder, according to prosecutors and those who knew the family.

Edie Mannion, manager of the training and education center for the Mental Health Association of Southeastern Pennsyvlania, said mental illness affects one in four families.

"It's always unexpected and a very unique experience because of the stigma and the uncertainty involved with it," she said. "It's not one-size-fits all. If anything, it's complicated."

She said that the rate of violence for people with schizophrenia or mood disorders is 16 percent - 9 percent above the average for the general population - and that family members of those affected by it are at the highest risk.

"There is more emotion in a family relationship and the history that builds up," she said. "If someone starts losing control of their behavior or becomes paranoid, what can be normal family tensions can erupt in to violence."

Mannion said that the burden can especially be tough on siblings and that James' attempt to understand his brother's condition is not uncommon.

Ferman said Joseph Jr. had no lengthy history of mental-health treatment and no contact with the law.

What triggered the violent attack Saturday night may never be known, but Mannion said that given his alleged bizarre statements to police, Joseph Jr. may have been experiencing a delusion.

She said she can't imagine what he will go through when he realizes what he did.

"I can't imagine the suffering he will have. I'm sure in his right mind he loves his family."