added code for formatting ring data;
clened up a few other things