removed j-- from body to while condition