Loops and decision making