first working loop