Sean's algorithm has two variables ```r``` and ```w```, and you just have ```r```. Are you sure that your variant does the same thing? If so you really should have commented on and explained the change here in your code so that people comparing your implementation to Sean's book won't be super confused.