updated based on wchen-r7 comments