Implements getting program input

Plus some other minor changes