added less loops