Delete unnececary loop while