Added the ring pattern and modified the logic a bit