Added Junit test and moved a couple things around.