Corrected filename plus minor code changes