added ring.c and ring.h