Initial input parsing mostly done