Implemented the Deque interface for flexibility, and also simplified the implementation slightly for the DataSet