How much does it cost to re roof a house?

Huge # of variables on this
  1. Where you live and the code the roof must adhere to, Miami must survive hurricane's, Where I live the code deals with Ice dams and snow load.
  2. Whats wrong, 1100 square foot house strip and re-shingle where I live was $3000 to $4000 last summer
  3. Hips and valleys cost more
  4. Repairs and upgrades cost a bunch, does it need sheeting? (new plywood)