weight as a one line function