plotting now works correctly