added some test and comments