fixing plotting bugs