adding some unit tests. shoulda done this first...but meh.