added 'while' keyword