The medication , commonly known as Viagra, is a doctor-approved treatment primarily used to manage erectile dysfunction in men . Developed initially for heart conditions , its unanticipated side effects relating to the widening of blood vessels led to its subsequent use as an reliable solution fo