Added functionality for saving results