nit: space after 'while'