added some functionality.  write some tests.