remove Patrick: line, change ?: to if, to make it clearer, and let one find the signed/unsigned compare