Patch calculate_sqs method