add more comments and tests