Update after testing vs David's code