Pls add some comment here that the input is not checked to be valid (since we dont want to spend all CPU time checking those things)