Added preferences and xml parser