Fix condition

The paper declares that prop<=a and not prop<a
Split result function in a more modular way
Refactor main