while loops work; passes test1-0 through test1-2