Added functionality to add to the beginning and ends of a circular list.