added extra tests, solved another bug