updated based on Corey's comments