In this paper, an explanatory program understander that can analyse student solutions for programming assignments is described. The approach uses a number of reverse engineering techniques and is grounded on a cognitive model of procedural programming knowledge. It will be shown that, through the use of reverse engineering techniques, a lot of feedback (e.g. on errors) can be generated without having to use any prior knowledge on what the program is supposed to do. When such information is available, problem-specific feedback can also be generated. Furthermore, the use of the cognitive programming concepts allows one to specify the errors in an understandable way using exactly the same words and concepts as human programmers. This opens interesting possibilities for other uses of the proposed program understanding technique described in this article.