while loops are now working