For many years, the game of chess has provided an invaluable task environment for research on cognition, in particular on the differences between novices and experts and the learning that removes these differences, and upon the structure of human memory and its paramaters. The template theory presented by Gobet and Simon based on the EPAM theory offers precise predictions on cognitive processes during the presentation and recall of chess positions. This article describes the behavior of CHREST, a computer implementation of the template theory, in a memory task when the presentation time is varied from one second to sixty, on the recall of game and random positions, and compares the model to human data. Strong players are better than weak players in both types of positions, especially with long presentation times, but even after brief presentations. CHREST predicts the data, both qualitatively and quantitatively. Strong players' superiority with random positions is explained by the large number of chunks they hold in LTM. Their excellent recall with short presentation times is explained by templates, a special class of chunks. CHREST is compared to other theories of chess skill, which either cannot account for the superiority of Masters in random positions or predict too strong a performance of Masters in such positions.