fixed plotting bugs