Create ring.erl

modified ring.erl, simplified it.