starts the loop from function a