Better loop accounting