Adding initial draft version written by Jouni.