more advanced apache formula -- attempt #2

Rebased and author changed.