update QS calculation