added comments, xml format and resources adaption