added some test and some changes