added several new things that probably don't work right.