added method to parse file