changes to saving samples