simple loop matching