updated based on comments