Updated per peer review and updated to fix logic