start implementing the loop