Rewrote the Data class, which had problems before