new tests, rearrangement of code for modularity's sake