A better way of handling the pattern weights.