added more functionality. updated some tests. needs more tests.