implemented for-loop syntax