Adding loops. Still more work to do...