This study examines the Krumhansl-Schmuckler key-finding model, in which the distribution of pitch classes in a piece is compared with an ideal distribution or "key profile" for each key. Several changes are proposed. First, the formula used for the matching process is somewhat simplified. Second, alternative values are proposed for the key profiles themselves. Third, rather than summing the durations of all events of each pitch class, the revised model divides the piece into short segments and labels each pitch class as present or absent in each segment. Fourth, a mechanism for modulation is proposed; a penalty is imposed for changing key from one segment to the next. An implementation of this model was subjected to two tests. First, the model was tested on the fugue subjects from Bach's Well-Tempered Clavier; the model's performance on this corpus is compared with the performances of other models. Second, the model was tested on a corpus of excerpts from the Kostka and Payne harmony textbook (as analyzed by Kostka). Several problems with the modified algorithm are discussed, concerning the rate of modulation, the role of harmony in key finding, and the role of pitch "spellings." The model is also compared with Huron and Parncutt's exponential decay model. The tests presented here suggest that the key-profile model, with the modifications proposed, can provide a highly successful approach to key finding.