an almost perfect loop