Task 1_3 perfomance and file write issue fixed