added a test for sort_avg_data, removed some prints from visualize