added lots more stuff, including better configuration