a for-loop is better here