fixed some little buggs
added some tests
added some tests