Add more robustness; handling omission of parameters
Refactor the input parsing to be separate