just tweaking plotting function