address comments and add test