Added input reading with lazy loading.