assignment3. loop