Some I/O Code improvements

added <key> as mandatory CLI arg instead of switch