Beginners trouble - loop that ends too quickly

Great.

Please also check these: