added a number of comments and -- absolutely non-generic --test data in order to better understand C code