Task 1.3 and Task 1.4 

Perfonmance bug fixes and filе output error