Shameless theft of haack's config