Yes, that's correct. I would always use { } brackets for the while() loop though - not needed here as you have only one command in the loop, but when you add more, missing brackets could be a possible error source.