added a part to break the loop, and converted tabs to spaces