Eliminate the while loop