Added loop, needs fixing