added test cases
Added file scanning and dynamic array sizing