modify to use input (working on it)