Lab 6: 3 (better solution)