added extra tests and fixed old