Add QM.findIndex

- refactor QM.firstAssigned to use QM.findIndex