The drug , commonly known as Viagra, is a regulated treatment primarily used to treat erectile dysfunction in males . Developed initially for cardiovascular problems , its surprising side effects relating to the widening of blood vessels led to its repurposing as an reliable solution for sexual health issues . It works by increasing circulation to