implemented alot of control parameters on file saving to enable saving of files even for a large numbe of cycles