duration issue is fixed
file write feature is added