Added preference loading and comments.