Please find attached the updated patch with tests.