modifications to mimic after reviewing solution