added tests to nail down functionality