added some test tests. fixed some bugs