fully changed to use XML