Changed list insertion, finally works. Read input from file.

Everything should work now.