Read from file, generate function added