Added most of Lionel's comments and edits.

Signed-off-by: Jouni Korhonen <jouni.korhonen@iki.fi>