Create input read function