Removed empty loops in code tidy-up