Added handling for file extensions
Changed Checks to Asserts