Nit: please add a space between `if` and `(`, as well as `while` and `(` below and in the rest of the file. Thanks!