TUCSON, AZ --Doctors treating wounded Rep. Gabrielle Giffords provided an optimistic update Sunday about her chances for survival, saying they are "very, very encouraged" by her ability to respond to simple commands along with their success in controlling her bleeding. Surgeons said a bullet went through Giffords' head on the left side of the brain, but she is still able to respond nonverbally to commands such as squeezing a hand or showing two fingers. They credited several reasons for her survival, including good luck and the fact that paramedics got her to surgeons quickly -- in under 40 minutes. "This is about as good as it is going to get," said Dr. Peter Rhee, a trauma surgeon. "When you get shot in the head and the bullet goes through your brain, the chances of you living is very small and the chances of you waking up and actually following commands is even much smaller than that. Hopefully it will stay that way." Surgeons worked to reduce pressure from swelling in her head by removing bone fragments, and they also removed a small amount of badly damaged brain. Giffords cannot speak because she is on a ventilator. Dr. Michael Lemole of the University Medical Center in Tucson would not speculate on her degree of recovery. "We talk about recovery in months to years," he said. The medical prognosis came as authorities investigated the motivation of a gunman in an attempted assassination of the three-term Democrat and the killing of six people, including a federal judge, an aide to Giffords and a 9-year-old girl who was born on Sept. 11, 2001. Mourners crammed into the tiny sanctuary of Giffords' synagogue in Tucson to pray that she quickly recovered. Outside the hospital, candles flickered at a makeshift memorial. Signs read "Peace + love are stronger," "God bless America and "We love you, Gabrielle." People also laid down bouquets of flowers, American flags and pictures of Giffords. Police say the shooter was in custody, and was identified by the FBI as Jared Loughner, 22. He was described by friends as a pot-smoking loner who was rejected by the Army when he tried to enlist in 2008. He dropped out of a local community college after having five contacts with campus police for classroom and library disruptions last year. His motivation was not immediately known, but Pima County Sheriff Clarence Dupnik described him as mentally unstable and possibly acting with an accomplice. Authorities said Giffords, 40, was targeted at a public gathering by a man with a semiautomatic weapon around 10 a.m. Saturday outside a busy Tucson supermarket. Fourteen people were injured. He also fired at her district director and shot indiscriminately at staffers and others standing in line to talk to the congresswoman, said Mark Kimble, a communications staffer for Giffords. "He was not more than three or four feet from the congresswoman and the district director," Kimble said, describing the scene as "just complete chaos, people screaming, crying." One of the victims was Christina-Taylor Green, who was a member of the student council at her local school and went to the event because of her interest in government. She is the grandaughter of former Philadelphia Phillies manager Dallas Green. She was born on 9/11 and featured in a book called "Faces of Hope" that chronicled one baby from each state born on the day terrorists killed nearly 3,000 people. The fact that Christina's life ended in tragedy was especially tragic to those who knew her. "Tragedy seems to have happened again," said the author of the book, Christine Naman. "In the form of this awful event." Authorities said the dead included U.S. District Judge John M. Roll; Greene; Giffords aide Gabe Zimmerman, 30; Dorothy Morris, 76; Dorwin Stoddard, 76; and Phyllis Scheck, 79. Judge Roll had just stopped by to see his friend Giffords after attending Mass. His office said a man possibly associated with Loughner (pronounced LAWF'-ner) who was near the scene was being sought. Law enforcement released an image of a man photographed by a security camera at the Safeway store. He was described as white with dark hair and 40-45 years old. FBI Director Robert Mueller said Loughner bought the Glock 9-mm handgun last year. In one of several YouTube videos, which featured text against a dark background, Loughner described inventing a new U.S. currency and complained about the illiteracy rate among people living in Giffords' congressional district in Arizona. "I know who's listening: Government Officials, and the People," Loughner wrote. "Nearly all the people, who don't know this accurate information of a new currency, aren't aware of mind control and brainwash methods. If I have my civil rights, then this message wouldn't have happen (sic)." In Loughner's middle-class neighborhood -- about a five-minute drive from the scene -- sheriff's deputies had much of the street blocked off. The neighborhood sits just off a bustling Tucson street and is lined with desert landscaping and palm trees. Neighbors said Loughner lived with his parents and kept to himself. He was often seen walking his dog, almost always wearing a hooded sweat shirt and listening to his iPod. The assassination attempt left Americans questioning whether divisive politics had pushed the suspect over the edge. Giffords faced frequent backlash from the right over her support of the health care reform last year, and had her office vandalized the day the House approved the landmark measure. When asked if Loughner had any contact with Giffords in the past, Mueller said the alleged gunman attended a similar event three years ago. Dupnik lashed out at what he called an excessively "vitriolic" atmosphere in the months leading up to the rampage as he described the chaos of the day. The sheriff said the rampage ended only after two people tackled the gunman. A third person intervened and tried to pull a clip away from Loughner as he attempted to reload, the sheriff said. "He was definitely on a mission," according to event volunteer Alex Villec, former Giffords intern. Giffords expressed similar concern about the political atmosphere, even before the shooting. In an interview after her office was vandalized, she referred to the animosity against her by conservatives, including Sarah Palin's decision to list Giffords' seat as one of the top "targets" in the midterm elections. "For example, we're on Sarah Palin's targeted list, but the thing is, that the way that she has it depicted has the crosshairs of a gun sight over our district. When people do that, they have to realize that there are consequences to that action," Giffords said in an interview with MSNBC. In the hours after the shooting, Palin issued a statement in which she expressed her "sincere condolences" to the family of Giffords and the other victims. A shaken President Barack Obama called the attack "a tragedy for our entire country." Attorney General Eric Holder said in a statement Sunday that FBI Director Robert Mueller was traveling to Arizona to help coordinate the investigation. In a brief statement Sunday morning, House Speaker John Boehner said flags on the House side of the Capitol in Washington will be flown at half staff to honor Giffords' slain aide, Gabe Zimmerman. Boehner says normal House business this week is postponed to focus on any necessary actions in the shooting aftermath.