modifying to implement input