added tests, working now.