vectorised beta update

runs fast!