Improved the for-loop