Fixing while loop
More readable