fixed indexing error in compute qlm