Restructured some of the code.
Added example for getting flavors.

Also made variables more explicit.