Implementing and testing non-indexed loops