update based on mr-c's comments