aded more test and some comments in the code