Resolution to infile bug
Bug Fix
Added annotations and simplified code