erased lines and added some code to save results