Improved behavior so any q can be plotted.