reorganized plotting, fixed replay