code working with while loops