Spliced in a bunch of code from DednDave for testing.