get() 'for' loop changed to 'while' for better syntax