add loop implementation.