Modified Input reader: Now seems working fine