Removed extra while lines