added for-loops