let names initialized with while block
de-complicate code
introduce bool, clean up