modified parsing and xml scripts slightly