while + loop seems a little redundant