fixed some more bugs along with I wrote more test