merge w. giulio (master)

should this instead be a public function, weight() ? (generally more future-proof)