nit: you can avoid creating `input`