Extend extract subject algorithm to work with entire test set