Here are the basic mechanics:
http://paulgraham.com/equity.htmlEDIT: The only other thing I can think of is that you need to make sure you're equally protected against dilution (like what happened to Eduardo Saverin), I don't really know how this usually works.