starting with code from old brads-wordpress package