There's a FAQ on livebearer breeding here:
Livebearers FAQ
Swordtails don't actually change sex, they just appear to. The dominant male in the tank prevents other males from growing their tail (I don't know if that's through hormonnes or behaviour). Some will show no sword, some will show a much shorter sword. The dominant male is the one with the longest sword. If the dominant male is removed, other males' swords will grow. The no-sword males are usually ones that have grown up in the tank. If you look at the fish, you will see a gonopodium on males with no swords.