implementation, test and comments