added more tests and bug fixs