Fixed a bug where the parameter H was sometimes chosen incorrectly.
Was looking for H where: choose(H,ceil(H/2)) > K + S.
Changed to: choose(H,ceil(H/2)) >= K + S.
My thanks to mlukoskkov for finding this bug.