Reimplemented changes after accidentally losing a lot of work. Got basic test data working.