From Stanford course by Tim Roughgarden