Update Week 4 code

Works now. I'm a bit unsure which probabilities to use for selection as the paper isn't very clear.