A 10-year-old got to the root of a problem by growing his hair.

Thomas Moore, a fifth-grader from Bowie, Maryland, didn’t cut his locks for two years just so he could donate them to cancer survivors.

Angie Pulos

By Sept. 10, when he chopped it all off, he had grown enough hair to make three wigs. The precious photos of him before and after his dramatic cut have gone viral, receiving more than 121,000 likes and 61,000 shares on Twitter:

my nephew grew his hair out for two years to donate to kids with cancer 😭 pic.twitter.com/YuamNNcMEI — amber lynne (@storkpatrol) September 11, 2016

Thomas was inspired to grow out his fab follicles after seeing a video on Facebook. It featured Kyssi Andrews, a then 5-year-old cancer patient from Houston, Texas who lost her hair from chemotherapy.

Thomas decided on the spot that he wanted to help by growing out his mane and donating it to those in need.

Angie Pulos

“My heart melted,” Angie Pulos, Thomas’s mom, told The Huffington Post of the moment he announced his decision. “He’s so stinkin’ sweet.”

Thomas ended up donating his hair to Reniece & Company, a salon in Rockville, Maryland that specializes in wigs.

Kyssi lost her battle with cancer in 2015, but the salon’s owner is partnering with Kyssi’s mom to find recipients for the wigs made from Thomas’s hair, Pulos told HuffPost.

Angie Pulos

Pulos said that after having so much hair for two years, Thomas had a moment of hesitation just before his cut. But she says he now digs his new ’do.

Angie Pulos

“He said he’s happy that when he goes outside his hair doesn’t get caught in the bushes,” Pulos told HuffPost with a laugh.

To learn more about the Kyssi Andrews Foundation, click here.

To learn more about Thomas’ story, watch the video below: