i want to direct this message at younger people, like me, who are single, already dedicated to the dhamma, have done several retreats, and attempted to keep the precepts for some years. granted this, i want to say this as unassumingly as possible: all the greatest masters were celibate or abstained from orgasm. if you didn't know that, then look into it. there's a reason the buddha said it's better to put your penis in a snake rather than a women to ananda. in some contexts, in some traditions (nyingma, e.g.) your own hand can be worse than having sex with an actual person. no, it's not painless to be celibate.
there came a point in my practice where i realized that either i stop masturbating or i don't progress. when you take away forms of escape, especially those outlined in the precepts, you have to face yourself more directly. that means a lot of pain, because life is suffering.
i found the following analogy to be very helpful: it's like being trapped in a flood, by your leg and the water is rising. would you let it drown you, or have someone saw your leg off right away? really the orgasm is so deeply imbedded in the psyche (not to generalize, but even the buddha said that lust is the hardest kilesa to overcome) that it is the psychological equivalent of having one's leg cut off. before you take oath's of chastity (if you were to), keep this in mind.
Just keep breathing in and out like this. Don't be interested in anything else. It doesn't matter even if someone is standing on their head with their ass in the air. Don't pay it any attention. Just stay with the in-breath and the out-breath. Concentrate your awareness on the breath. Just keep doing it. http://www.ajahnchah.org/book/Just_Do_It_1_2.php